-
Notifications
You must be signed in to change notification settings - Fork 54
Add CLI site create/start logs to Studio console #2298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CLI site create/start logs to Studio console #2298
Conversation
gcsecsey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving the logging @bcotrim! 🙌
I confirm that I see the logs when adding or starting a site.
However, I couldn't get the WP CLI output to get logged in the Studio console. In another tab, I tested listing the site plugins:
node dist/cli/main.js wp plugin list --path ~/Studio/my-wordpress-website-7
But I only see the output in the original tab.
|
@gcsecsey thanks for reviewing and testing. |
gcsecsey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gcsecsey thanks for reviewing and testing. Did you run those WP CLI from a terminal outside of Studio? If that's the case we don't capture those logs. If you run the WP CLI from the Assistant tab for example, you should see the logs in Studio. Sorry if the instructions weren't clear, I've updated them.
Thanks @bcotrim for updating the steps. Yes indeed, earlier I tried running the CLI commands from another terminal tab. I now tested running it through the Assistant, and this works great, I can see the output in the console.
sejas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works as described. I can see the logs in the console:
Logs
pp version: 1.6.7
Environment: development
Built from commit: dev
Local timezone: Europe/Madrid
App locale: en-US
System locale: en-US@rg=eszzzz
Used language: en
Setting Sentry user ID: 8.....10
Would have bumped stat: studio-app-launch-total=darwin
Would have bumped stat: studio-app-launch-uniques=darwin
WordPress latest folder already exists. Skipping download.
SQLite Command is up to date.
Starting server for 'SQLite 2.2.15'
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Loading site…
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Starting process daemon...
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Setting up SQLite integration, if needed...
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Starting WordPress site...
Sentry Logger [log]: [Offline Store]: Popping envelope from offline storage
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Starting up workers…
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Booting WordPress…
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Running the Blueprint…
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Finished running the Blueprint…
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Preparing workers…
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] WordPress is running
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] Site URL: http://localhost:8888
Username: admin
Password: eWtAUSVUNSN4WjdGSjlFUExQTWMwI3lz
Server started for 'SQLite 2.2.15'
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] {"name":"Twenty Twenty-Five","path":"\/wordpress\/wp-content\/themes\/twentytwentyfive","slug":"twentytwentyfive","isBlockTheme":true,"supportsWidgets":false,"supportsMenus":false}
[CLI - 2f62560c-5cfb-4c8e-a389-df468348dc80] {"name":"Twenty Twenty-Five","path":"\/wordpress\/wp-content\/themes\/twentytwentyfive","slug":"twentytwentyfive","isBlockTheme":true,"supportsWidgets":false,"supportsMenus":false}
(node:6104) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
[CLI - 1bc690dc-03df-4807-b887-c8b07a178b1f] []
[CLI - 1bc690dc-03df-4807-b887-c8b07a178b1f] http://localhost:8892
[CLI - 1bc690dc-03df-4807-b887-c8b07a178b1f] http://localhost:8892
[CLI - 1bc690dc-03df-4807-b887-c8b07a178b1f] []
[CLI - 1bc690dc-03df-4807-b887-c8b07a178b1f] [{"name":"twentytwentyfive","status":"active","update":"none","version":"1.4","update_version":"","auto_update":"off"},{"name":"twentytwentyfour","status":"inactive","update":"none","version":"1.4","update_version":"","auto_update":"off"},{"name":"twentytwentythree","status":"inactive","update":"none","version":"1.6","update_version":"","auto_update":"off"}]
[CLI - 1bc690dc-03df-4807-b887-c8b07a178b1f] [{"name":"twentytwentyfive","status":"active","update":"none","version":"1.4","update_version":"","auto_update":"off"},{"name":"twentytwentyfour","status":"inactive","update":"none","version":"1.4","update_version":"","auto_update":"off"},{"name":"twentytwentythree","status":"inactive","update":"none","version":"1.6","update_version":"","auto_update":"off"}]
[CLI - 1bc690dc-03df-4807-b887-c8b07a178b1f] +---------+----------+--------+---------+----------------+-------------+
[CLI - 1bc690dc-03df-4807-b887-c8b07a178b1f] | name | status | update | version | update_version | auto_update |
+---------+----------+--------+---------+----------------+-------------+
| akismet | inactive | none | 5.6 | | off |
| hello | inactive | none | 1.7.2 | | off |
| db.php | dropin | | | | off |
+---------+----------+--------+---------+----------------+-------------+


Related issues
Proposed Changes
logPrefixoption toexecuteCliCommandto identify which site the logs belong to[CLI - {siteId}]prefixcli-site-creator.ts)cli-server-process.ts)site-server.ts)This restores the logging behavior that was available before switching to CLI for site create/start operations, making debugging easier.
Testing Instructions
npm start[CLI - {siteId}]Pre-merge Checklist